#include <stdio.h>
int main()
{
    int arr[3] = {0};
    int i = 0;

    while (1)
    {
        int temp;
        scanf("%d", &temp);
        if (temp < 0)
            break;
        else if (temp >= 0 && temp < 18)
        {
            arr[0]++;
        }
        else if (temp >= 18 && temp < 25)
        {
            arr[1]++;
        }
        else if (temp >= 25 && temp <= 30)
        {
            arr[2]++;
        }
    }
    printf("%d %d %d", arr[2], arr[1], arr[0]);
    return 0;
}
